package com.dzl.goods;

import com.dzl.admin.WelfareBaseInfoController;
import com.dzl.base.controller.BaseController;
import com.dzl.base.query.BaseQuery;
import com.dzl.goods.pojo.vo.WelfareGoodsClassifyEntryRelVo;
import com.dzl.goods.service.WelfareGoodsClassifyEntryRelService;
import com.dzl.util.JsonResult;
import com.dzl.util.PageUtils;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 分类入口商品表(welfare_goods_classify_entry_rel)表控制层
 * @author liuguanjun
 * @date 2021-12-29 16:11:42
 */
@Slf4j
@RestController
@RequestMapping("/welfareGoodsClassifyEntry")
public class WelfareGoodsClassifyEntryRelController extends WelfareBaseInfoController {


    @Autowired
    private WelfareGoodsClassifyEntryRelService service;

    /**
     * 查询分类入口设置商品列表
     * @param query 查询实体类
     * @author liuguanjun
     * @date 2021-12-29 16:46:56
     **/
    @GetMapping("getGoodsListRel")
    public PageUtils<WelfareGoodsClassifyEntryRelVo> getGoodsListManage(BaseQuery query) {
        Integer enterpriseId=getDataSourcesEnterpriseId();
        query.setEnterpriseId(enterpriseId);
        PageInfo<WelfareGoodsClassifyEntryRelVo> pageInfo = service.getGoodsListClassifyEntryRelPageWeb(query);
        return new PageUtils<>(pageInfo);
    }


    /**
     * 获取分类入口详细信息
     * @author liuguanjun
     * @since 2021-12-29 17:09:22
     **/
    @GetMapping(value = "getGoodsClassifyEntryInfo")
    public JsonResult<Map> getGoodsInfo() {
        return JsonResult.success(service.getGoodsClassifyEntryInfo());
    }


}
